/************** init.html **************/
function query_invDepot(page) {
	sys_loading();
	var parm = $('#queryinvDepotForm').serialize() + (page != null ? ('&page=' + page) : '');
	var url = create_url('invDepot-query');
	sys_record_parm('invDepot',parm);
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_loading_close();
			$('#ResultList').html(result);
		}
	});
}


function shield_invDepot(code, name) {
	$.Zebra_Dialog('确定屏蔽 吗？',{
	'type': 'question',
	'title': '警告' ,
	'buttons':[
       {caption:'屏蔽',callback:function() {
    	   var url = create_url('invDepot-shield');
    	   aidExecute_invDepot(code, url);
		}},
       {caption:'取消',callback:function(){}
       }]
	});
}

function unshield_invDepot(code, name) {
	$.Zebra_Dialog('确定要解除屏蔽吗？',{
	'type': 'question',
	'title': '警告' ,
	'buttons':[
       {caption:'解除',callback:function() {
    	   var url = create_url('invDepot-unshield');
    	   aidExecute_invDepot(code, url);
		}}, 
       {caption:'取消',callback:function(){}
       }]
	});
}
function aidExecute_invDepot(code, url) {
	var parm = {'code':code};
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_submiting_close();
			if ('success' == result) {
				query_invDepot();
			} else {
				$.Zebra_Dialog('操作失败，请刷新页面再次尝试，如果问题依然存在，请联系管理员!');
			}
		}
	});
}
function save_invDepot() {
	var parm = $('#editinvDepotForm').serialize();
	var url = create_url('invDepot-save');
	sys_submiting();
	$.ajax({type:'POST', url:url, data:parm,
		success: function(result) {
			sys_submiting_close();
			if (result == 'success') {
				sys_msg('操作成功!');
				sys_load_handle('invDepot');
			} else if(result == 'exists') {
				sys_msg('名称重复!');
			} else {
				sys_msg('操作失败！')
			}
		}
	});
}